<template>
  <div>
    <div class="name__wrapper">
      <span class="name">{{ communityName?.value || '' }}</span>
      <span
        class="detail"
        id="community-region-detail"
        @click="handleCommunityRegionDetailClick"
        >详情&nbsp;></span
      >
    </div>
    <div
      class="property"
      v-for="(item, index) in propertyList.value"
      :key="index"
    >
      <span>{{ item.label }}:</span>
      <span>{{ item.value }}</span>
    </div>
    <div
      class="operation"
      v-if="
        (status?.value == -1 || status?.value == 2) &&
        currentUser?.hasPermission(PERMISSIONS.一张图审核)
      "
    >
      <div
        class="button pass"
        id="community-pass"
        @click="handleCommunityPassClick"
      >
        <span>通过</span>
      </div>
      <div
        class="button reject"
        id="community-reject"
        @click="handleCommunityRejectClick"
      >
        <span>驳回</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    currentUser: {
      type: Object,
    },
    propertyList: {
      type: Object,
    },
    name: {
      type: Object,
    },
    communityName: {
      type: Object,
    },
    status: {
      type: Object,
    },
    handleCommunityRegionDetailClick: {
      type: Function,
    },
    handleCommunityPassClick: {
      type: Function,
    },
    handleCommunityRejectClick: {
      type: Function,
    },
  },
}
</script>

<script setup>
import { PERMISSIONS } from '@/common/user'
</script>

<style scoped lang="scss"></style>
